package com.example.day1103;

import com.example.day11.Cat;

/**
 * @author Lenovo
 */
public class AnimalDemo {
    public static void main(String[] args) {
        Animal.Jumpping j = new Animal.Jumpping() {
            @Override
            public void jump() {

            }
        };
        j.jump();
        System.out.println("--------");

        Animal a = new Animal();
        a.setName("加菲猫");
        a.setAge(5);
        System.out.println(a.getName() + "," + a.getAge());
        a.eat();
        a = new Animal("加菲",5);
        System.out.println(a.getName() + "," + a.getAge());
        a.eat();
        System.out.println("--------");
        Cat c = new Cat();
        c.setName("加菲猫");
        c.setAge(5);
        System.out.println(c.getName() + "," + c.getAge());
        c.eat();
        c.jump();
    }
}
